package ball.sneaker;

import ball.sneaker.client.Connection;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;



/**
 *
 * @author Arthur
 */
public class SneakerClient {

    static final int DEFAULT_CLIENT_PORT = 80;

    static public void main(String args[]){

        ServerSocket server = null;
        try {
            server = new ServerSocket(DEFAULT_CLIENT_PORT);
        } catch (IOException ex) {
            Logger.getLogger(SneakerClient.class.getName()).log(Level.SEVERE, null, ex);
            
        }

        boolean finished = false;
        while(!finished){
            Socket s = null;
            try {
                s = server.accept();
                Connection c = new Connection(s);
                Thread t = new Thread(c);
                t.start();
            } catch (IOException ex) {
                Logger.getLogger(SneakerClient.class.getName()).log(Level.SEVERE, null, ex);  
            } 
        }

        return;
    }

}
